package com.it.enums.flow;

import lombok.Getter;

/**
 * @author TBH
 * @date 2025-05-15 15:15:01
 * @desc
 */
@Getter
public enum ConditionType {
    PASSED(1, "通过"), REJECTED(2, "拒绝");

    private int code;
    private String type;

    ConditionType(int code, String type) {
        this.code = code;
        this.type = type;
    }

    public static ConditionType getTypeByCode(int code) {
        for (ConditionType conditionType : ConditionType.values()) {
            if (conditionType.code == code) {
                return conditionType;
            }
        }
        return null;
    }
}